'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
     return queryInterface.sequelize.transaction(async t => {
      await queryInterface.bulkInsert("sys_role", [
        {
          role_id:1,
          role_name:"超级管理员",
          role_key:"admin",
          role_sort:1,
          data_scope:"1",
          menu_check_strictly:1,
          dept_check_strictly:1,
          status:"0",
          remark:"超级管理员",
          created_at: new Date(),
          updated_at: new Date(),
        },{
          role_id:2,
          role_name:"普通角色",
          role_key:"common",
          role_sort:2,
          data_scope:"2",
          menu_check_strictly:1,
          dept_check_strictly:1,
          status:"0",
          remark:"普通角色",
          created_at: new Date(),
          updated_at: new Date(),
        },
      ], { transaction: t });
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
     return queryInterface.sequelize.transaction(async t => {
      return await queryInterface.bulkDelete("sys_role", null, { transaction: t });
    })
  }
};
